class Solution:
	# @param {integer} m
	# @param {integer} n
	# @return {integer}
	def rangeBitwiseAnd(self, m, n):
		if m == 0:
			return 0
		# count the length of the binary of `m` and `n`
		lm = len("{0:b}".format(m))
		ln = len("{0:b}".format(n))
		# if length differ, return 0
		if lm < ln:
			return 0
		else:
			i = 0
			while m != n:
				m = m >> 1
				n = n >> 1
				i += 1
			return m << i

if __name__ == '__main__':
	so = Solution()
	print so.rangeBitwiseAnd(0,1)
